package cn.yunbamboos.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "yunbamboos")
public class YunbamboosProperties {

    private String modelPackageName;
    /**项目名称*/
    private String projectPath = "";
    /**rest服务路径*/
    private String restServicePath = "";

    private TaskThread taskThread = new TaskThread();
    private DynamicTaskThread dynamicTaskThread = new DynamicTaskThread();
    private ScheduledTaskThread scheduledTaskThread = new ScheduledTaskThread();

    public String getModelPackageName() {
        return modelPackageName;
    }

    public void setModelPackageName(String modelPackageName) {
        this.modelPackageName = modelPackageName;
    }

    public String getProjectPath() {
        return projectPath;
    }

    public void setProjectPath(String projectPath) {
        this.projectPath = projectPath;
    }

    public String getRestServicePath() {
        return restServicePath;
    }

    public void setRestServicePath(String restServicePath) {
        this.restServicePath = restServicePath;
    }

    public TaskThread getTaskThread() {
        return taskThread;
    }

    public void setTaskThread(TaskThread taskThread) {
        this.taskThread = taskThread;
    }

    public DynamicTaskThread getDynamicTaskThread() {
        return dynamicTaskThread;
    }

    public void setDynamicTaskThread(DynamicTaskThread dynamicTaskThread) {
        this.dynamicTaskThread = dynamicTaskThread;
    }

    public ScheduledTaskThread getScheduledTaskThread() {
        return scheduledTaskThread;
    }

    public void setScheduledTaskThread(ScheduledTaskThread scheduledTaskThread) {
        this.scheduledTaskThread = scheduledTaskThread;
    }

    public static class TaskThread {
        private int corePoolSize = 1;
        private int maxPoolSize = 1;
        private int queueCapacity = 10;
        private int keepAliveTime = 60;
        private String threadNamePrefix = "task-";

        public int getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(int corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public int getMaxPoolSize() {
            return maxPoolSize;
        }

        public void setMaxPoolSize(int maxPoolSize) {
            this.maxPoolSize = maxPoolSize;
        }

        public int getQueueCapacity() {
            return queueCapacity;
        }

        public void setQueueCapacity(int queueCapacity) {
            this.queueCapacity = queueCapacity;
        }

        public int getKeepAliveTime() {
            return keepAliveTime;
        }

        public void setKeepAliveTime(int keepAliveTime) {
            this.keepAliveTime = keepAliveTime;
        }

        public String getThreadNamePrefix() {
            return threadNamePrefix;
        }

        public void setThreadNamePrefix(String threadNamePrefix) {
            this.threadNamePrefix = threadNamePrefix;
        }
    }

    public static class DynamicTaskThread {
        private int corePoolSize = 1;
        private String threadNamePrefix = "dynamic-task-";

        public int getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(int corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public String getThreadNamePrefix() {
            return threadNamePrefix;
        }

        public void setThreadNamePrefix(String threadNamePrefix) {
            this.threadNamePrefix = threadNamePrefix;
        }
    }

    public static class ScheduledTaskThread {
        private int corePoolSize = 1;
        private String threadNamePrefix = "scheduled-task-";

        public int getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(int corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public String getThreadNamePrefix() {
            return threadNamePrefix;
        }

        public void setThreadNamePrefix(String threadNamePrefix) {
            this.threadNamePrefix = threadNamePrefix;
        }
    }

}
